// 组件路由写法
import App from '../App'
import Home from '../views/home'
import About from '../views/about'
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'
// 两种路由模式组件 BrowserRouter (history模式) hashRouter (hash模式)
const BaseRouter = () => (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<App/>}>
          {/* 路由重定向 */}
          <Route path="/" element={<Navigate to="/home"/>}/>
          <Route path="/home" element={<Home/>}/>
          <Route path="/about" element={<About/>}/>
        </Route>
      </Routes>
    </BrowserRouter>
    )
export default BaseRouter